<div class="main">	        	           
            
			<?php echo $this->load->view('layout/left');?>
            
            <div class="main-r">
                
                <div class="products">
                    <div class="box-sp">
                    	<span class="title">
                        	<h2>Sản phẩm theo danh mục: </h2><b><?php echo $type->name;?></b>
                        </span>                    
                        <?php if(isset($products) && $products != null) {?>
                        <?php foreach($products as $k => $v){?>
                        <div class="line-sp<?php echo($k%3==0 ? ' first' : '');?>">    
                        		<?php $img_path = $this->home_model->get_images_products_by_product_id($v->id);?>
                        		<a href="<?php echo base_url().'show-room/detail/'.$v->id.'/'.$v->name_link.'.html';?>" title="<?php echo $v->name;?>">                	
    	                    		<img src="<?php echo ($img_path ? site_url($img_path[0]->img_path) : '');?>" title="<?php echo $v->name;?>" alt="<?php echo $v->name;?>" class="thumb" />
    	                    	</a>
    	                        <div class="sp-r">
    	                        	
    	                            
    	                        </div>
    	                        <div class="price">
                                    <p class="name"><a href="<?php echo base_url().'show-room/detail/'.$v->id.'/'.$v->name_link.'.html';?>" title="<?php echo $v->name;?>"><?php echo $v->name;?></a></p>
    	                        	<font class="pr">Giá: <?php echo format_type_money($v->price);?> VNĐ</font><br />
    	                            <p><a href="<?php echo base_url().'dat-hang/dat-hang/'.$v->code;?>" class="btn-dat">Đặt hàng</a></p>
    	                        </div>                        
                        </div>
                        <?php }?>
                        <?php }?>
                        
                                           
                    </div>
                    
                    <div class="box-pagination">
                        <div class="pagination">
                            <?php echo $pagnav;?>
                        </div>
                    </div>
                    
                    
                </div><!--End products-->
                
                <?php $this->load->view('layout/right');?>
                
            </div>
            
        </div>
        <div class="main-news">
        	<div class="item-news">
            	<h2>Công trình</h2>            	
                <ul class="listnews">
                <?php if(isset($news_works) && $news_works != null) {?>
                <?php foreach($news_works as $k => $v) { ?>                
                	<?php if($k == 0) {?>
                	<li class="top">
                    	<h2><a href="<?php echo base_url().'tin-tuc-bai-viet/detail/'.$v->id.'/'.$v->title_link.'.html';?>" title="<?php echo $v->title;?>"><?php echo $v->title;?></a></h2>
                    	<?php $img_path = $this->home_model->get_images_news($v->id);?>
                    	<?php if(isset($img_path) && $img_path != null) {?>
                        	<img src="<?php echo show_thumb($img_path[0]->img_path,'108-75');?>" title="" alt="" class="thumb" />
                        <?php } else {?>
                        	<img src="<?php echo img_link('no_image.gif');?>" title="" alt="" class="thumb" />
                        <?php }?>
                        <?php echo character_limiter($v->description,500);?>
                    </li>
                   	<?php } else if($k > 0){?>
                	<li><a href="<?php echo base_url().'tin-tuc-bai-viet/detail/'.$v->id.'/'.$v->title_link.'.html';?>" title="<?php echo $v->title;?>"><?php echo $v->title;?></a></li>
                	<?php }?>
                <?php }?>
                <?php }?>
                </ul>
            </div>
            
            <div class="item-news">
            	<h2>Tin tức</h2>
                <ul class="listnews">
                <?php if(isset($all_news) && $all_news != null) {?>
                <?php foreach($all_news as $k => $v){?>
                	<li>
                		<a href="<?php echo base_url().'tin-tuc-bai-viet/detail/'.$v->id.'/'.$v->title_link.'.html';?>" title="<?php echo $v->title;?>"><?php echo character_limiter($v->title,100);?></a> 
                		<?php if($k == 0) {?>
                			<img src="<?php echo img_link('i-hot.gif');?>" title="" alt="" />
                		<?php }?>
                	</li>
                <?php }?>
                <?php }?>
                </ul>
            </div>
            <?php if(isset($questions) && count($questions) > 0) {?>
            <div class="item-news no-bg">
            	<h2>Tư vấn - Hỏi đáp</h2>
                <ul class="listnews">
                	<li class="top">
                		<b><?php echo $questions[0]->fullname;?></b> - <font class="date"><?php echo date('d-m-Y', strtotime($questions[0]->date_create)); ?></font><br />
                		<a href="<?php echo base_url().'tu-van-hoi-dap/detail/'.$questions[0]->id.'/'.$questions[0]->title_link.'.html';?>" title="<?php echo $questions[0]->title;?>"><?php echo character_limiter($questions[0]->title,100);?></a>
                	</li>
                </ul>
                <div class="b-question">
                	<div class="i-arrow"><span></span></div>
                	<div class="ct-qs"><?php echo character_limiter($questions[0]->answers,300);?></div>
                </div>
                <span class="linkview"><a href="<?php echo base_url().'tu-van-hoi-dap/detail/'.$questions[0]->id.'/'.$questions[0]->title_link.'.html';?>" class="viewmore">Xem chi tiết</a></span>
            </div> 
            <?php }?>           
        </div>
        
        <?php if(isset($all_partner) && count($all_partner)>0){?>
        <div class="b-carosel">
        	<div id="Pictures">
                <div class="Pre">
                    <a href="#" onclick="sp.showPreviousPanel(1); return false;">
                        <img src="<?php echo img_link('btn_prev01.gif');?>" alt=""></a></div>
                        <div class="Next">
                            <a href="#" onclick="sp.showNextPanel(1); return false;">
                                <img src="<?php echo img_link('btn_next01.gif');?>" alt=""></a>
                        </div>
                        <div valign="middle" style="overflow: hidden;" id="slidingPanel" class="SlidingPanels SlideControlAni">
                            <div style="left: -30.4045px; top: 0px;" class="SlideControlCGroup">
                        <?php  foreach($all_partner as $part){?>
                        <div class="ContentSlide">
                            <a href="<?php echo $part->website;?>" target="_blank"><img src="<?php echo $part->logo;?>" alt="<?php echo $part->name;?>" title="<?php echo $part->name;?>" /></a>
                        </div>
                        <?php }?>
                    </div>
                </div>
            </div>          
        </div>
        <?php }?>